{extend name="./view/base/admin.html" /}
{block name="body"}
<div class="card">
    <div class="card-header">
        <a href="{:url('add')}" class="btn btn-success">添加角色</a>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>角色名称</th>
                        <th>状态</th>
                        <th>添加时间</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($list as $v):?>
                    <tr>
                        <td><?=$v['id']?></td>
                        <td><?=$v['name']?></td>
                        <td><?=$v['status']?'正常':'禁用'?></td>
                        <td><?=$v['create_time']?></td>
                        <td><?=$v['update_time']?></td>
                        <td>
                            <?php if($v['id']!=1):?>
                            <a href="{:url('edit',['id'=>$v['id']])}" class="btn btn-xs btn-warning">编辑</a>
                            <button class="btn btn-xs btn-danger" @click="del({id:{$v['id']}})">删除</button>
                            <?php endif;?>
                        </td>
                    </tr>
                    <?php endforeach;?>
                </tbody>
            </table>
        </div>
        {$list->render()}
    </div>
</div>
{/block}
{block name="script"}
<script>
    new Vue({
        el:'#content'
    })
</script>
{/block}